﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;

namespace ORMEntityFrameworkXJ
{
    public class Program
    {
        static void Main(string[] args)
        {

            //1.
            Database.SetInitializer(new DbInit());

            using (Admin1314DbContex contex = new Admin1314DbContex()) 
            {
                var list = contex.Users.ToList();
                Console.WriteLine(list);
            }
            //2.
            //using (Admin1314DbContex contex = new Admin1314DbContex())
            //{
            //    contex.Database.Initialize(true);

            //    contex.Users.Add(new Users
            //    {
            //        UserName = "admin",
            //        Password = "123",
            //        IsActived = true,
            //        IsDeleted = false,
            //        CreatedTime = DateTime.Now,
            //        UpdatedTime = DateTime.Now,
            //        Remarks = "小俊有点忧伤"
            //    });

            //    contex.SaveChanges();
            //}



        }
    }
}
